// 获取歌词
let timeExec = /\[(\d{2}):(\d{2}).(\d{2,3})\]/;
export default function getSong(word) {
  let songWord = [];
  let newWord = word.split('\n')
  // console.log(newWord);
  for (var first of newWord) {
    // console.log(first);
    // 抽取时间转换成毫秒
  let time=timeExec.exec(first);
  if(!time) continue;
  let minute=time[1]*60*1000;
  let second=time[2]*1000;
  let ms=time[3].length==2?time[3]*10:time[3]*1;
  const times=minute+second+ms;
  // 对应时间
  // console.log(times);
  // 获取每一句对应歌词
  let words=first.replace(timeExec,"");
  let obj={
    words,times
  }
  // console.log(words);
  songWord.push(obj)
  }
  return songWord
}